package com.jiang.demo.controller;

import com.jiang.demo.merge.DemoMergeExecutor;
import com.jiang.starter.web.cache.ClientCache;
import com.jiang.starter.web.gzip.Gzip;
import com.jiang.starter.web.merge.Merge;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class WebController {

    @ClientCache(60)
    @GetMapping("/client/cache")
    public String cache(Long id) {
        System.out.println("/client/cache被执行了");
        return "demo-client-cache-" + id;
    }

    @Merge(executor = DemoMergeExecutor.class)
    @GetMapping("/merge")
    public String merge(Long id) {
        return null;
    }

    @Gzip
    @GetMapping("/gzip")
    public String gzip(Long id) {
        return "demo-gzip-" + id;
    }

}
